<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <f:view>

        <ui:composition template="maintemplate.xhtml">

            <ui:define name="title">#{labels.admin_page_title}</ui:define>

            <ui:define name="body">

                <h:form id="createComment">

                    <h:panelGrid columns="2">

                        <h:outputLabel value="#{labels.admin_add_comment_title}"/>
                        <h:inputText id="title" value="#{CommentManagedBean.title}" required="true">

                            <f:validateLength for="title" minimum="5" maximum="40"/>

                        </h:inputText>
                        <h:outputLabel value="#{labels.admin_add_comment_tags}"/>
                        <h:inputText value="#{CommentManagedBean.tags}"/>
                        <h:outputLabel value="#{labels.admin_add_comment_body}"/> 
                        <h:inputTextarea value="#{CommentManagedBean.body}" required="true"/>

                        <h:outputLabel value="#{labels.admin_add_comment_category}"/>

                        <h:selectOneMenu value="#{CommentManagedBean.category}">


                            <c:forEach var="category" items="#{CommentManagedBean.getAddCommentsCategories()}">

                                <f:selectItem itemLabel="#{category}" itemValue="#{category}"/>

                            </c:forEach>

                        </h:selectOneMenu>



                        <h:commandButton action="#{CommentManagedBean.commitComment}" value="Submit"/>

                    </h:panelGrid>

                </h:form>

                <h:message for="createComment" showDetail="true"/>

            </ui:define>

        </ui:composition>

    </f:view>

</html>
